<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
	<title>添加声音消息</title>
	<link rel="shortcut icon" type="image/ico" href="${basePath}/favicon.ico?v=1"/>
	<link rel="stylesheet" type="text/css" href="${basePath}/css/style-1.css" />
	<link rel="stylesheet" type="text/css" href="${basePath}/css/style_2_common.css" />
	<link rel="stylesheet" type="text/css" href="${basePath}/css/more_img.css" />
	<script type="text/javascript" src="${basePath}/js/jquery-1.8.3.min.js"></script>
	<link rel="stylesheet" type="text/css" href="${basePath}/js/layer/skin/layer.css" />
    <script type="text/javascript" src="${basePath}/js/layer/layer.m.js"></script>
</head>
<body id="nv_member" class="pg_CURMODULE">
	<#assign current='menu_voice'>
	<div id="wp" class="wp">
		<#include "/include/header.html"/>
		<!--中间内容-->
		<div class="contentmanage">
			<div class="developer">
				<div class="tableContent">
					<#include "/include/left.html"/>
					<#include "/include/wxtop.html"/>
					<div class="content">
						<div class="cLineB">
							<h4 style="font-size:16px;">编辑语音回复</h4>
						</div>
						<div class="msgWrap">
							<form  action="${basePath}/admin/voice/persis" method="post" class="form" onsubmit="return checkForm();">
								<input type="hidden" name="id" <#if bean?exists>value="${bean.id?default('')}"<#else>value=""</#if> />
								<table width="100%" cellspacing="0" cellpadding="0" border="0" style="margin: 20px 0 0 0;" class="userinfoArea">
									<thead>
										<tr>
											<th valign="top">
												<span class="red">*</span><label for="keyword">关键词：</label>
											</th>
											<td>
												<input type="text" required  placeholder="请输入关键词" style="width: 600px" name=keywords value="${bean.keywords?default('')}" id="keyword" class="px">
												<br>多个关键词请用空格格开：例如:美丽&nbsp;漂亮&nbsp;好看
											</td>
										</tr>
										<tr>
											<th valign="top">
												<span class="red">*</span><label for="Title">音乐标题：</label>
											</th>
											<td>
												<input type="text" required placeholder="请输入音乐标题" style="width: 600px" name="title" value="${bean.title?default('')}" id="title" class="px">
											</td>
										</tr>
										<tr>
											<th valign="top">
												<span class="red">*</span><label for="MusicUrl">音乐链接：</label>
											</th>
											<td>
												<input type="text" readonly placeholder="请上传文件" required style="width: 600px" name="linkUrl" value="${bean.linkUrl?default('')}" id="linkUrl" class="px">
												<a class="a_upload" href="javascript:void(0);" onclick="picUpload(1)">上传</a>&nbsp;
												<p><b>文件大小不超过5M，时长不超过60秒(否则语音不能发送出去)，支持mp3/wma/wav/amr格式。</b></p>
											</td>
										</tr>
										<tr>
											<#-- 
											<th valign="top">
												<span class="red">*</span><label for="HQMusicUrl">高品质音乐链接：</label>
											</th>
											<td>
												<input type="text" placeholder="请上传文件或填写音乐链接" required style="width: 600px" name="hightLinkUrl" value="${bean.hightLinkUrl?default('')}" id="HQMusicUrl" class="px">
												<a class="a_upload" href="javascript:void(0);" onclick="picUpload(2)">上传</a>&nbsp; 
												<a class="a_upload" href="javascript:void(0);">选择</a>
												<br>没有高品质音乐链接，请直接再填一遍音乐链接。（高质量音乐链接，WIFI环境优先使用该链接播放音乐）
											</td>
											 -->
										</tr>
									</thead>
									<tbody>
										<tr>
											<th valign="top">
												<label for="Description">音乐描述：</label>
											</th>
											<td>
												<textarea style="width: 600px;" maxlength='30' name="description" id="Hfcontent" placeholder="输入音乐描述" class="px">${bean.description?default('')}</textarea>
												<br>请不要多于30字否则无法发送!
											</td>
										</tr>
										<tr>
											<th></th>
											<td>
												<button class="btnGreen left" name="button" type="submit">保存</button>
											</td>
										</tr>
									</tbody>
								</table>
							</form>
						</div>
					</div>
					<div class="clr"></div>
				</div>
			</div>
		</div>
		<!--底部-->
	</div>
	<#include "/include/footer.html"/>
	
	<script type="text/javascript">
		function checkForm(){
			var $keyword = $("#keyword");
			var $title = $("#title");
			var $linkUrl = $("#linkUrl");
			if($keyword.val()==null || $keyword.val()==''){
				layer.alert("请输入关键词",{icon:0});
				$keyword.focus();
				return false;
			}
			if($title.val()==null || $title.val()==''){
				layer.alert("请输入音乐标题",{icon:0});
				$title.focus();
				return false;
			}
			if($linkUrl.val()==null || $linkUrl.val()==''){
				layer.alert("音乐链接不能为空",{icon:0});
				$linkUrl.focus();
				return false;
			}
			return true;
		}
		var layerIndex = 0;
        function picUpload(flag){
        	layerIndex = layer.open({
			    type: 2,
			    area: ['600px', '450px'],
			    fix: true,
			    title: '上传音频',
			    content: '${basePath}/admin/voice/up?flag='+flag
			});
        }
        //关闭弹出框并给地址栏传值
        function closeWin(url, flag, msg){
        	if(null==url){
        		if(msg && msg!=""){
    				layer.msg(msg,{shade: [0.8, '#393D49']});
        		}else{
	        		layer.msg("上传失败，请重新上传",{shade: [0.8, '#393D49']});
        		}
        		layer.close(layerIndex);
        		return;
        	}
        	layer.msg("上传成功",{shade: [0.8, '#393D49']});
        	layer.close(layerIndex);
        	if(flag==1){
	        	$("#linkUrl").val(url);
        	}else if(flag==2){
        		$("#HQMusicUrl").val(url);
        	}
        }
	</script>
</body>
</html>